Not able to iterate links in beselined module

Hello,

I have a problem with analysing links in a module. What I want to do is checking a module, if every object it contains has a link. This works fine, if I work on the current version:

Module m_CurMod = current Module
int rejected = 0
Object obj
Link lref
for obj in m_CurMod do
{
    for lref in (obj) <- "*" do 
        {
                bFound = true
                rejected++
                break;
        }
}


Nevertheless, this does not work anymore, if I analyse a specific baseline of a module. It does iterate the correct objects in the modules, but it does not find any links.

 

m_lastBlsMod = load(m_CurMod, lastBaseline, false) //lastBaseline is a not-null baseline in the module
for obj in m_lastBlsMod do
{
    for lref in (obj) <- "*" do 
        {
                bFound = true
                rejected++
                break;
        }
}


Does anyone know, what the reason might be? I'm really running out of ideas...

 


Simon@BM - Thu Oct 21 04:40:21 EDT 2010

Re: Not able to iterate links in beselined module
Mathias Mamsch - Thu Oct 21 07:55:10 EDT 2010

See this post. You need to do
 

LinkRef lr 
for lr in all (o<-"*") do { ... }

 


to find those non-echoed inlinks. Regards, Mathias

 

 

 


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

 

 

Re: Not able to iterate links in beselined module
Simon@BM - Thu Oct 21 09:01:21 EDT 2010

Mathias Mamsch - Thu Oct 21 07:55:10 EDT 2010

See this post. You need to do
 

LinkRef lr 
for lr in all (o<-"*") do { ... }

 


to find those non-echoed inlinks. Regards, Mathias

 

 

 


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

 

 

Thanks a lot!!

Re: Not able to iterate links in beselined module
llandale - Thu Oct 21 09:06:58 EDT 2010

oddly, I have yet to deal with versioned links. But browsing some layout using some Wizard, I have the following code fragment that seems to work:

Link            lnk
Module          mDiscrep, mSource,
                mLink           = null
ModName_        mnSource        = null
ModuleVersion   mvSource        = null
Object          oDiscrep
for lnk in all(obj<-"*") do
{  mLink      = module(lnk)
   if (name(mLink) != "Discrepancy_Links") continue
   mvSource = sourceVersion(lnk)
   mnSource = module(mvSource)
   if (null mnSource or isDeleted mnSource) continue
   oDiscrep = source(lnk)
   if (null oDiscrep) {
       load(mvSource,false)
   }
   oDiscrep     = source(lnk)
   if (null oDiscrep or isDeleted oDiscrep) continue
   <<< deal with good link>>>
}


The key here seems to be use of the 'all', <<for lnk in all(obj<-"*") do>>

 

 

  • Louie